package com.fansl.allround.oss.api.feign.factory;

import com.fansl.allround.oss.api.feign.RemoteQiniuOssService;
import com.fansl.allround.oss.api.feign.fallback.RemoteQiniuOssServiceFallbackImpl;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author fansl
 * @Description: TODO
 * @date 2019/9/3 17:11
 */
@Component
public class RemoteQiniuOssServiceFallbackFactory implements FallbackFactory<RemoteQiniuOssService> {
    @Override
    public RemoteQiniuOssService create(Throwable throwable) {
        RemoteQiniuOssServiceFallbackImpl qiniuOssServiceFallback = new RemoteQiniuOssServiceFallbackImpl();
        qiniuOssServiceFallback.setCause(throwable);
        return qiniuOssServiceFallback;
    }
}
